import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooLinkGroupController } from '../../../controllers';
const uctoolinkGroupRouter = new Router();
const linkGroupController = new uctooLinkGroupController();

uctoolinkGroupRouter.post('/add', requireUser, linkGroupController.add);
uctoolinkGroupRouter.post('/edit', requireUser, rowLevelPermission('uctoo/link_group'), linkGroupController.edit);
uctoolinkGroupRouter.post('/del', requireUser, rowLevelPermission('uctoo/link_group'), linkGroupController.delete);

//For getting linkGroup with permission control
uctoolinkGroupRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/link_group'), linkGroupController.getSingle);
uctoolinkGroupRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/link_group'), linkGroupController.getMany);
uctoolinkGroupRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/link_group'), linkGroupController.getMany);

//#endregion AutoCreateCode
export default uctoolinkGroupRouter;
